<template>
	<view class="Cj">
		<view class="message_top">
			<view class="message_top_title" :style="{top:computedTop}">红包设置</view>
			<view class="message_top_back" :style="{top:computedTop}" @click="Back">
				<image src="../../static/search/back.png" class="bfbimages"></image>
			</view>
		</view>

		<view class="Cj_box">
			<view class="Cj_tab">
				<view>选择红包类型</view>
				<view>
					<view :class="item.isA?'tab1':'tab'" v-for="(item,index) in tab" :key="index"
						@click="Ctab(item,index)">
						{{item.name}}
					</view>
				</view>
			</view>

			<!-- 现金红包 -->
			<template v-if="tab[0].isA">
				<view class="cj_hb">
					<view class="cj_hb_list">
						<view class="cj_hb_list_L">
							<text>红包名称</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp">
								<input type="text" placeholder="请输入标题"
									style="font-size: 28rpx;color: #333333;margin-left: 10rpx;" v-model="name" />
							</view>
						</view>
					</view>

	
					<view class="cj_hb_list_text" style="font-size: 28rpx;color: #F95518;">
						<text><text style="color: #999999;">账户余额：</text>￥{{SJbalance}}</text>
						<view style="display: flex;align-items: center;justify-content: flex-end;margin-left: 100rpx;" @click="LinkQianBao">
							<text>去充值</text>
							<view class="flex"
								style="width: 20rpx;height: 23rpx;text-align: center;line-height: 23rpx;">
								<image src="../../static/red_right.png" class="bfbimages"></image>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>红包数量</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入" style="margin-left: 10rpx;margin-right: 10rpx;"
									v-model="total_nums" />
								<text>个</text>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>红包类型</text>
						</view>
						<view class="cj_hb_list_R">
							<view :class="item.isA?'cj_hb_list_R_tab1':'cj_hb_list_R_tab'"
								v-for="(item,index) in hbtype" :key="index" @click="Ctype(item)">{{item.name}}</view>
						</view>
					</view>
					
					<view class="cj_hb_list" style="margin: 60rpx auto 0;" v-if="hbtype[0].isA">
						<view class="cj_hb_list_L"></view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" style="width: auto;">
								<input type="text" placeholder="请输入"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;"
									v-model="forward_money" />
								<text>元/被领取一次</text>
							</view>
						</view>
					</view>
					
					<view class="cj_hb_list_type" v-if="hbtype[1].isA">
						<view>
							<input type="text" placeholder="最低金额" style="color: #333333;" v-model="min_money" />
						</view>
						<view></view>
						<view>
							<input type="text" placeholder="最高金额" style="color: #333333;" v-model="highest_money" />
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>转发佣金</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_selete">
								<u-switch v-model="valueA" @change="changeZF" activeColor="#FE4624"></u-switch>
							</view>
							<view class="cj_hb_list_selete">
								<view class="flex"
									style="width: 28rpx;height: 28rpx;text-align: center;line-height: 28rpx;margin-right: 6rpx;">
									<image src="../../static/red_wenhao.png" class="bfbimages"></image>
								</view>
								<text>规则</text>
							</view>
							<!-- 	<view class="cj_hb_list_selete">
								<text>不可转发</text>
								<label>
									<checkbox :value="checkboxvalue"
										style="width: 28rpx;height: 28rpx;background: #CCCCCC;margin-left: 5rpx;" />
								</label>
							</view> -->
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 50rpx auto 0;">
						<view class="cj_hb_list_L">
							<text></text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" style="width: auto;">
								<input type="text" placeholder="请输入"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;"
									v-model="forward_money" />
								<text>元/被领取一次</text>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>抢完自动发</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_selete">
								<u-switch v-model="valueB" @change="changeZD" activeColor="#FE4624"></u-switch>
							</view>
							<view class="cj_hb_list_selete">
								<view class="flex"
									style="width: 28rpx;height: 28rpx;text-align: center;line-height: 28rpx;margin-right: 6rpx;">
									<image src="../../static/red_wenhao.png" class="bfbimages"></image>
								</view>
								<text>规则</text>
							</view>
							<view class="cj_hb_list_selete"></view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>领取时段</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									v-model="expire_day" />
								<text>天</text>
							</view>
						</view>
					</view>


					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>发放范围</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_selete" v-for="(item,index) in FnaweiList" :key="index"
								style="margin-right: 8rpx;">
								<text>{{item.name}}</text>
								<label>
									<checkbox :value="item.isA" :checked="item.isA"
										style="width: 28rpx;height: 28rpx;background: #CCCCCC;margin-left: 5rpx;transform:scale(0.7)"
										@click="Cfwei(item)" />
								</label>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;" v-if="FnaweiList[1].isA">
						<view class="cj_hb_list_L" style="justify-content: flex-end;">
							<text>行政范围</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" @click="SeleteDW">
								<input type="text" placeholder="请选择" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									:disabled="true" v-model="coordinate" />
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;" v-if="FnaweiList[2].isA">
						<view class="cj_hb_list_L" style="justify-content: flex-end;">
							<text>地图选点</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" @click="Mapselete" style="justify-content: space-between;">
								<input type="text" placeholder="请选择"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;" :disabled="true"
									v-model="MapCweiz" />
								<view class="flex"
									style="width: 25rpx;height: 25rpx;text-align: center;line-height: 25rpx;">
									<image src="../../static/dqwz.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L" style="justify-content: flex-end;">
							<text>方圆公里数</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;"
									v-model="distance_nums" @input='input' />
								<text style="color: #666666;">公里</text>
							</view>
						</view>
					</view>

					<view class="cj_hb_list_map">
						<map id="myMap" style="width:100%;height:100%;" :markers="markers" :latitude="latitude"
							:longitude="longitude" :scale="scale"></map>
					</view>

					<view class="cj_hb_list_gg">
						<text>广告内容</text>
						<view>
							<view :class="item.isA?'cj_hb_list_gg_tab1':'cj_hb_list_gg_tab'"
								v-for="(item,index) in GG_tab" :key="index" @click="Cggtab(item)">{{item.name}}</view>
						</view>
					</view>
					<!-- 使用规则 -->
					<view class="cj_hb_list_gg_gz" v-if="GG_tab[0].isA">
						<u--textarea v-model="ad_content" placeholder="请输入" :height="150" border="none"></u--textarea>
					</view>
					<!-- 图片 -->
					<view class="cj_hb_list_gg_tp" v-if="GG_tab[1].isA">

						<view class="set_box_up_for_src flex" v-for="(item,index) in ad_content" :key="index">
							<image :src="item.url" class="bfbimages"></image>
						</view>

						<view class="set_box_up_for_up" @click="Upimages" v-if="ad_content.length<3">
							<view class="flex">
								<image src="../../static/xj.png" class="bfbimages"></image>
							</view>
							<view>上传</view>
						</view>
					</view>
					<!-- 视频 -->


					<view class="cj_hb_list_gg_sp flex" v-if="GG_tab[2].isA" v-for="(item,index) in ad_content"
						:key="index">
						<video :src="item.url" class="bfbimages" contain='fill'></video>
					</view>

					<view class="cj_hb_list_gg_sp flex" v-if="GG_tab[2].isA" @click="Updiveo">
						<view class="cj_hb_list_gg_sp_btn">
							<view class="flex">
								<image src="../../static/UP1.png" class="bfbimages"></image>
							</view>
							<text>视频上传</text>
						</view>
					</view>

					<view class="cj_hb_list_gg_tis" v-if="GG_tab[2].isA">
						<text>温馨提示:</text><br />
						<text>上传视频，服务器存储费每兆{{GG.mb_price}}元;</text><br />
						<text>被浏览一次{{GG.play_video}}元</text><br />
						<text>账户余额不足时此视频将不被展示!</text><br />
					</view>

					<!-- <view class="cj_hb_list" style="margin: 60rpx auto 0;justify-content: space-between;">
						<view class="cj_hb_list_L" style="width: 400rpx;">
							<text>使用已上传的商家资料</text>
						</view>
						<view class="cj_hb_list_R" style="display: flex;align-items: center;justify-content: flex-end;">
							<u-switch v-model="value" @change="change" activeColor="#FE4624"></u-switch>
						</view>
					</view> -->

					<view class="cj_hb_btn" @click="XianJinApi">确定</view>

					<cityPicker :column="column" :default-value="defaultValue" :mask-close-able="maskCloseAble"
						@confirm="confirmXZ" @cancel="cancel" :visible="visible" />
				</view>
			</template>

			<!-- 优惠卷 -->
			<template v-if="tab[1].isA">
				<view class="cj_hb">
					<view class="cj_hb_list">
						<view class="cj_hb_list_L">
							<text>红包名称</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp">
								<input type="text" placeholder="请输入标题"
									style="font-size: 28rpx;color: #333333;margin-left: 10rpx;" v-model="name" />
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;" @click="Cmb">
						<view class="cj_hb_list_L">
							<text>优惠券模版</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请选择" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									:disabled="true" v-model="MBname"/>
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>
					<view class="cj_hb_list_moban">
						<image src="../../static/yhj.png" class="bfbimages" v-if="MBname=='模板一'"></image>
						<image src="../../static/yhj2.png" class="bfbimages" v-if="MBname=='模板二'"></image>
						<image src="../../static/yhj3.png" class="bfbimages" v-if="MBname=='模板三'"></image>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>优惠券金额</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									v-model="total_money" />
								<text>个</text>
							</view>
						</view>
					</view>
					<view class="cj_hb_list_text" style="font-size: 28rpx;color: #F95518;">
						<text><text style="color: #999999;">账户余额：</text>￥{{SJbalance}}</text>
						<view style="display: flex;align-items: center;justify-content: flex-end;margin-left: 100rpx;"  @click="LinkQianBao">
							<text>去充值</text>
							<view class="flex"
								style="width: 20rpx;height: 23rpx;text-align: center;line-height: 23rpx;">
								<image src="../../static/red_right.png" class="bfbimages"></image>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>优惠券数量</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									v-model="total_nums" />
								<text>个</text>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>转发佣金</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_selete">
								<u-switch v-model="valueA" @change="changeZF" activeColor="#FE4624"></u-switch>
							</view>
							<view class="cj_hb_list_selete">
								<view class="flex"
									style="width: 28rpx;height: 28rpx;text-align: center;line-height: 28rpx;margin-right: 6rpx;">
									<image src="../../static/red_wenhao.png" class="bfbimages"></image>
								</view>
								<text>规则</text>
							</view>
							<!-- 	<view class="cj_hb_list_selete">
							<text>不可转发</text>
							<label>
								<checkbox :value="checkboxvalue"
									style="width: 28rpx;height: 28rpx;background: #CCCCCC;margin-left: 5rpx;" />
							</label>
						</view> -->
						</view>
					</view>
					<view class="cj_hb_list" style="margin: 50rpx auto 0;">
						<view class="cj_hb_list_L">
							<text></text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" style="width: auto;">
								<input type="text" placeholder="请输入"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;"
									v-model="forward_money" />
								<text>元/被领取一次</text>
							</view>
						</view>
					</view>



					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>是否核销</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_selete">
								<u-switch v-model="valueC" @change="changeHX" activeColor="#FE4624"></u-switch>
							</view>
							<view class="cj_hb_list_selete"></view>
							<view class="cj_hb_list_selete"></view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>领取时段</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									v-model="expire_day" />
								<text>天</text>
							</view>
						</view>
					</view>


					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>发放范围</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_selete" v-for="(item,index) in FnaweiList" :key="index"
								style="margin-right: 8rpx;">
								<text>{{item.name}}</text>
								<label>
									<checkbox :value="item.isA" :checked="item.isA"
										style="width: 28rpx;height: 28rpx;background: #CCCCCC;margin-left: 5rpx;transform:scale(0.7)"
										@click="Cfwei(item)" />
								</label>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;" v-if="FnaweiList[1].isA">
						<view class="cj_hb_list_L" style="justify-content: flex-end;">
							<text>行政范围</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" @click="SeleteDW">
								<input type="text" placeholder="请选择" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									:disabled="true" v-model="coordinate" />
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;" v-if="FnaweiList[2].isA">
						<view class="cj_hb_list_L" style="justify-content: flex-end;">
							<text>地图选点</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" @click="Mapselete" style="justify-content: space-between;">
								<input type="text" placeholder="请选择"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;" :disabled="true"
									v-model="MapCweiz" />
								<view class="flex"
									style="width: 25rpx;height: 25rpx;text-align: center;line-height: 25rpx;">
									<image src="../../static/dqwz.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L" style="justify-content: flex-end;">
							<text>方圆公里数</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;"
									v-model="distance_nums" @input='input' />
								<text style="color: #666666;">公里</text>
							</view>
						</view>
					</view>

					<view class="cj_hb_list_map">
						<map id="myMap" style="width:100%;height:100%;" :markers="markers" :latitude="latitude"
							:longitude="longitude" :scale="scale"></map>
					</view>

					<view class="cj_hb_list_gg">
						<text>广告内容</text>
						<view>
							<view :class="item.isA?'cj_hb_list_gg_tab1':'cj_hb_list_gg_tab'"
								v-for="(item,index) in GG_tab" :key="index" @click="Cggtab(item)">{{item.name}}</view>
						</view>
					</view>
					<!-- 使用规则 -->
					<view class="cj_hb_list_gg_gz" v-if="GG_tab[0].isA">
						<u--textarea v-model="ad_content" placeholder="请输入" :height="150" border="none"></u--textarea>
					</view>
					<!-- 图片 -->
					<view class="cj_hb_list_gg_tp" v-if="GG_tab[1].isA">

						<view class="set_box_up_for_src flex" v-for="(item,index) in ad_content" :key="index">
							<image :src="item.url" class="bfbimages"></image>
						</view>

						<view class="set_box_up_for_up" @click="Upimages" v-if="ad_content.length<3">
							<view class="flex">
								<image src="../../static/xj.png" class="bfbimages"></image>
							</view>
							<view>上传</view>
						</view>
					</view>
					<!-- 视频 -->


					<view class="cj_hb_list_gg_sp flex" v-if="GG_tab[2].isA" v-for="(item,index) in ad_content"
						:key="index">
						<video :src="item.url" class="bfbimages" contain='fill'></video>
					</view>

					<view class="cj_hb_list_gg_sp flex" v-if="GG_tab[2].isA" @click="Updiveo">
						<view class="cj_hb_list_gg_sp_btn">
							<view class="flex">
								<image src="../../static/UP1.png" class="bfbimages"></image>
							</view>
							<text>视频上传</text>
						</view>
					</view>

					<view class="cj_hb_list_gg_tis" v-if="GG_tab[2].isA">
						<text>温馨提示:</text><br />
						<text>上传视频，服务器存储费每兆{{GG.mb_price}}元;</text><br />
						<text>被浏览一次{{GG.play_video}}元</text><br />
						<text>账户余额不足时此视频将不被展示!</text><br />
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;justify-content: space-between;">
						<view class="cj_hb_list_L" style="width: 400rpx;">
							<text>使用已上传的商家资料</text>
						</view>
						<view class="cj_hb_list_R" style="display: flex;align-items: center;justify-content: flex-end;">
							<u-switch v-model="value" @change="change" activeColor="#FE4624"></u-switch>
						</view>
					</view>

					<view class="cj_hb_btn">确定</view>

					<cityPicker :column="column" :default-value="defaultValue" :mask-close-able="maskCloseAble"
						@confirm="confirmXZ" @cancel="cancel" :visible="visible" />
						
					<u-picker :show="showMB" :columns="columnsMB" @cancel='showMB=false' @confirm='confirmMB'></u-picker>
				</view>
			</template>

			<!-- 邀约 -->
			<template v-if="tab[2].isA">
				<view class="cj_hb">
					<view class="cj_hb_list">
						<view class="cj_hb_list_L">
							<text>红包名称</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp">
								<input type="text" placeholder="请输入标题"
									style="font-size: 28rpx;color: #333333;margin-left: 10rpx;" v-model="name" />
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>红包金额</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									v-model="total_money" />
								<text>元</text>
							</view>
						</view>
					</view>
					<view class="cj_hb_list_text" style="font-size: 28rpx;color: #F95518;">
						<text><text style="color: #999999;">账户余额：</text>￥{{SJbalance}}</text>
						<view style="display: flex;align-items: center;justify-content: flex-end;margin-left: 100rpx;"  @click="LinkQianBao">
							<text>去充值</text>
							<view class="flex"
								style="width: 20rpx;height: 23rpx;text-align: center;line-height: 23rpx;">
								<image src="../../static/red_right.png" class="bfbimages"></image>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>红包数量</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									v-model="total_nums" />
								<text>个</text>
							</view>
						</view>
					</view>

				<!-- 	<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>红包类型</text>
						</view>
						<view class="cj_hb_list_R">
							<view :class="item.isA?'cj_hb_list_R_tab1':'cj_hb_list_R_tab'"
								v-for="(item,index) in hbtype" :key="index" @click="Ctype(item)">{{item.name}}</view>
						</view>
					</view> -->

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>转发佣金</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_selete">
								<u-switch v-model="valueA" @change="changeZF" activeColor="#FE4624"></u-switch>
							</view>
							<view class="cj_hb_list_selete">
								<view class="flex"
									style="width: 28rpx;height: 28rpx;text-align: center;line-height: 28rpx;margin-right: 6rpx;">
									<image src="../../static/red_wenhao.png" class="bfbimages"></image>
								</view>
								<text>规则</text>
							</view>
							<!-- 	<view class="cj_hb_list_selete">
							<text>不可转发</text>
							<label>
								<checkbox :value="checkboxvalue"
									style="width: 28rpx;height: 28rpx;background: #CCCCCC;margin-left: 5rpx;" />
							</label>
						</view> -->
						</view>
					</view>
					<view class="cj_hb_list" style="margin: 50rpx auto 0;">
						<view class="cj_hb_list_L">
							<text></text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" style="width: auto;">
								<input type="text" placeholder="请输入"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;"
									v-model="forward_money" />
								<text>元/被领取一次</text>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>签到时间</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" @click="Cdate(1)">
								<input type="text" placeholder="请选择"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 180rpx;font-size: 18rpx;color: #333333;" :disabled="true"
									v-model="start_signA" />
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>

							<view
								style="width:22rpx;height: 2rpx;background: #000000;margin-left: 5rpx;margin-right: 5rpx;">
							</view>

							<view class="cj_hb_list_R_inp2" @click="Cdate(2)">
								<input type="text" placeholder="请选择"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 180rpx;font-size: 18rpx;color: #333333;" :disabled="true"
									v-model="start_signB" />
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>签退时间</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" @click="Cdate(3)">
								<input type="text" placeholder="请选择"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 180rpx;font-size: 18rpx;color: #333333;" :disabled="true"
									v-model="end_signA" />
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>

							<view
								style="width:22rpx;height: 2rpx;background: #000000;margin-left: 5rpx;margin-right: 5rpx;">
							</view>

							<view class="cj_hb_list_R_inp2" @click="Cdate(4)">
								<input type="text" placeholder="请选择"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 180rpx;font-size: 18rpx;color: #333333;" :disabled="true"
									v-model="end_signB" />
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>



					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>领取时段</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									v-model="expire_day" />
								<text>天</text>
							</view>
						</view>
					</view>


					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>发放范围</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_selete" v-for="(item,index) in FnaweiList" :key="index"
								style="margin-right: 8rpx;">
								<text>{{item.name}}</text>
								<label>
									<checkbox :value="item.isA" :checked="item.isA"
										style="width: 28rpx;height: 28rpx;background: #CCCCCC;margin-left: 5rpx;transform:scale(0.7)"
										@click="Cfwei(item)" />
								</label>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;" v-if="FnaweiList[1].isA">
						<view class="cj_hb_list_L" style="justify-content: flex-end;">
							<text>行政范围</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" @click="SeleteDW">
								<input type="text" placeholder="请选择" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									:disabled="true" v-model="coordinate" />
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;" v-if="FnaweiList[2].isA">
						<view class="cj_hb_list_L" style="justify-content: flex-end;">
							<text>地图选点</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" @click="Mapselete" style="justify-content: space-between;">
								<input type="text" placeholder="请选择"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;" :disabled="true"
									v-model="MapCweiz" />
								<view class="flex"
									style="width: 25rpx;height: 25rpx;text-align: center;line-height: 25rpx;">
									<image src="../../static/dqwz.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L" style="justify-content: flex-end;">
							<text>方圆公里数</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;"
									v-model="distance_nums" @input='input' />
								<text style="color: #666666;">公里</text>
							</view>
						</view>
					</view>

					<view class="cj_hb_list_map">
						<map id="myMap" style="width:100%;height:100%;" :markers="markers" :latitude="latitude"
							:longitude="longitude" :scale="scale"></map>
					</view>

					<view class="cj_hb_list_gg">
						<text>广告内容</text>
						<view>
							<view :class="item.isA?'cj_hb_list_gg_tab1':'cj_hb_list_gg_tab'"
								v-for="(item,index) in GG_tab" :key="index" @click="Cggtab(item)">{{item.name}}</view>
						</view>
					</view>
					<!-- 使用规则 -->
					<view class="cj_hb_list_gg_gz" v-if="GG_tab[0].isA">
						<u--textarea v-model="ad_content" placeholder="请输入" :height="150" border="none"></u--textarea>
					</view>
					<!-- 图片 -->
					<view class="cj_hb_list_gg_tp" v-if="GG_tab[1].isA">

						<view class="set_box_up_for_src flex" v-for="(item,index) in ad_content" :key="index">
							<image :src="item.url" class="bfbimages"></image>
						</view>

						<view class="set_box_up_for_up" @click="Upimages" v-if="ad_content.length<3">
							<view class="flex">
								<image src="../../static/xj.png" class="bfbimages"></image>
							</view>
							<view>上传</view>
						</view>
					</view>
					<!-- 视频 -->


					<view class="cj_hb_list_gg_sp flex" v-if="GG_tab[2].isA" v-for="(item,index) in ad_content"
						:key="index">
						<video :src="item.url" class="bfbimages" contain='fill'></video>
					</view>

					<view class="cj_hb_list_gg_sp flex" v-if="GG_tab[2].isA" @click="Updiveo">
						<view class="cj_hb_list_gg_sp_btn">
							<view class="flex">
								<image src="../../static/UP1.png" class="bfbimages"></image>
							</view>
							<text>视频上传</text>
						</view>
					</view>

					<view class="cj_hb_list_gg_tis" v-if="GG_tab[2].isA">
						<text>温馨提示:</text><br />
						<text>上传视频，服务器存储费每兆{{GG.mb_price}}元;</text><br />
						<text>被浏览一次{{GG.play_video}}元</text><br />
						<text>账户余额不足时此视频将不被展示!</text><br />
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;justify-content: space-between;">
						<view class="cj_hb_list_L" style="width: 400rpx;">
							<text>使用已上传的商家资料</text>
						</view>
						<view class="cj_hb_list_R" style="display: flex;align-items: center;justify-content: flex-end;">
							<u-switch v-model="value" @change="change" activeColor="#FE4624"></u-switch>
						</view>
					</view>

					<view class="cj_hb_btn">确定</view>

					<cityPicker :column="column" :default-value="defaultValue" :mask-close-able="maskCloseAble"
						@confirm="confirmXZ" @cancel="cancel" :visible="visible" />

					<u-datetime-picker :show="showdate" v-model="value1" mode="datetime"
						:formatter="formatter" @cancel='showdate=false' @confirm='confirmDate'></u-datetime-picker>
				</view>
			</template>

			<!-- 卷包红包 -->
			<template v-if="tab[3].isA">
				<view class="cj_hb">
					<view class="cj_hb_list">
						<view class="cj_hb_list_L">
							<text>红包名称</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp">
								<input type="text" placeholder="请输入标题"
									style="font-size: 28rpx;color: #333333;margin-left: 10rpx;" v-model="name" />
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>红包金额</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									v-model="total_money" />
								<text>元</text>
							</view>
						</view>
					</view>
					<view class="cj_hb_list_text" style="font-size: 28rpx;color: #F95518;">
						<text><text style="color: #999999;">账户余额：</text>￥{{SJbalance}}</text>
						<view style="display: flex;align-items: center;justify-content: flex-end;margin-left: 100rpx;"  @click="LinkQianBao">
							<text>去充值</text>
							<view class="flex"
								style="width: 20rpx;height: 23rpx;text-align: center;line-height: 23rpx;">
								<image src="../../static/red_right.png" class="bfbimages"></image>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>红包数量</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									v-model="total_nums" />
								<text>个</text>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>红包类型</text>
						</view>
						<view class="cj_hb_list_R">
							<view :class="item.isA?'cj_hb_list_R_tab1':'cj_hb_list_R_tab'"
								v-for="(item,index) in hbtype" :key="index" @click="Ctype(item)">{{item.name}}</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>转发佣金</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_selete">
								<u-switch v-model="valueA" @change="changeZF" activeColor="#FE4624"></u-switch>
							</view>
							<view class="cj_hb_list_selete">
								<view class="flex"
									style="width: 28rpx;height: 28rpx;text-align: center;line-height: 28rpx;margin-right: 6rpx;">
									<image src="../../static/red_wenhao.png" class="bfbimages"></image>
								</view>
								<text>规则</text>
							</view>
							<!-- 	<view class="cj_hb_list_selete">
						<text>不可转发</text>
						<label>
							<checkbox :value="checkboxvalue"
								style="width: 28rpx;height: 28rpx;background: #CCCCCC;margin-left: 5rpx;" />
						</label>
					</view> -->
						</view>
					</view>
					<view class="cj_hb_list" style="margin: 50rpx auto 0;">
						<view class="cj_hb_list_L">
							<text></text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" style="width: auto;">
								<input type="text" placeholder="请输入"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;"
									v-model="forward_money" />
								<text>元/被领取一次</text>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>签到时间</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" @click="Cdate(1)">
								<input type="text" placeholder="请选择"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 180rpx;font-size: 18rpx;color: #333333;" :disabled="true"
									v-model="start_signA" />
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>
					
							<view
								style="width:22rpx;height: 2rpx;background: #000000;margin-left: 5rpx;margin-right: 5rpx;">
							</view>
					
							<view class="cj_hb_list_R_inp2" @click="Cdate(2)">
								<input type="text" placeholder="请选择"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 180rpx;font-size: 18rpx;color: #333333;" :disabled="true"
									v-model="start_signB" />
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>
					
					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>签退时间</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" @click="Cdate(3)">
								<input type="text" placeholder="请选择"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 180rpx;font-size: 18rpx;color: #333333;" :disabled="true"
									v-model="end_signA" />
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>
					
							<view
								style="width:22rpx;height: 2rpx;background: #000000;margin-left: 5rpx;margin-right: 5rpx;">
							</view>
					
							<view class="cj_hb_list_R_inp2" @click="Cdate(4)">
								<input type="text" placeholder="请选择"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 180rpx;font-size: 18rpx;color: #333333;" :disabled="true"
									v-model="end_signB" />
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>



					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>领取时段</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									v-model="expire_day" />
								<text>天</text>
							</view>
						</view>
					</view>


					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L">
							<text>发放范围</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_selete" v-for="(item,index) in FnaweiList" :key="index"
								style="margin-right: 8rpx;">
								<text>{{item.name}}</text>
								<label>
									<checkbox :value="item.isA" :checked="item.isA"
										style="width: 28rpx;height: 28rpx;background: #CCCCCC;margin-left: 5rpx;transform:scale(0.7)"
										@click="Cfwei(item)" />
								</label>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;" v-if="FnaweiList[1].isA">
						<view class="cj_hb_list_L" style="justify-content: flex-end;">
							<text>行政范围</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" @click="SeleteDW">
								<input type="text" placeholder="请选择" style="margin-left: 10rpx;margin-right: 10rpx;color: #333333;"
									:disabled="true" v-model="coordinate" />
								<view class="flex"
									style="width: 20rpx;height: 10rpx;text-align: center;line-height: 10rpx;">
									<image src="../../static/hei_xia.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;" v-if="FnaweiList[2].isA">
						<view class="cj_hb_list_L" style="justify-content: flex-end;">
							<text>地图选点</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2" @click="Mapselete" style="justify-content: space-between;">
								<input type="text" placeholder="请选择"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;" :disabled="true"
									v-model="MapCweiz" />
								<view class="flex"
									style="width: 25rpx;height: 25rpx;text-align: center;line-height: 25rpx;">
									<image src="../../static/dqwz.png" class="bfbimages"></image>
								</view>
							</view>
						</view>
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;">
						<view class="cj_hb_list_L" style="justify-content: flex-end;">
							<text>方圆公里数</text>
						</view>
						<view class="cj_hb_list_R">
							<view class="cj_hb_list_R_inp2">
								<input type="text" placeholder="请输入"
									style="margin-left: 10rpx;margin-right: 10rpx;width: 150rpx;color: #333333;"
									v-model="distance_nums" @input='input' />
								<text style="color: #666666;">公里</text>
							</view>
						</view>
					</view>

					<view class="cj_hb_list_map">
						<map id="myMap" style="width:100%;height:100%;" :markers="markers" :latitude="latitude"
							:longitude="longitude" :scale="scale"></map>
					</view>

					<view class="cj_hb_list_gg">
						<text>广告内容</text>
						<view>
							<view :class="item.isA?'cj_hb_list_gg_tab1':'cj_hb_list_gg_tab'"
								v-for="(item,index) in GG_tab" :key="index" @click="Cggtab(item)">{{item.name}}</view>
						</view>
					</view>
					<!-- 使用规则 -->
					<view class="cj_hb_list_gg_gz" v-if="GG_tab[0].isA">
						<u--textarea v-model="ad_content" placeholder="请输入" :height="150" border="none"></u--textarea>
					</view>
					<!-- 图片 -->
					<view class="cj_hb_list_gg_tp" v-if="GG_tab[1].isA">

						<view class="set_box_up_for_src flex" v-for="(item,index) in ad_content" :key="index">
							<image :src="item.url" class="bfbimages"></image>
						</view>

						<view class="set_box_up_for_up" @click="Upimages" v-if="ad_content.length<3">
							<view class="flex">
								<image src="../../static/xj.png" class="bfbimages"></image>
							</view>
							<view>上传</view>
						</view>
					</view>
					<!-- 视频 -->


					<view class="cj_hb_list_gg_sp flex" v-if="GG_tab[2].isA" v-for="(item,index) in ad_content"
						:key="index">
						<video :src="item.url" class="bfbimages" contain='fill'></video>
					</view>

					<view class="cj_hb_list_gg_sp flex" v-if="GG_tab[2].isA" @click="Updiveo">
						<view class="cj_hb_list_gg_sp_btn">
							<view class="flex">
								<image src="../../static/UP1.png" class="bfbimages"></image>
							</view>
							<text>视频上传</text>
						</view>
					</view>

					<view class="cj_hb_list_gg_tis" v-if="GG_tab[2].isA">
						<text>温馨提示:</text><br />
						<text>上传视频，服务器存储费每兆{{GG.mb_price}}元;</text><br />
						<text>被浏览一次{{GG.play_video}}元</text><br />
						<text>账户余额不足时此视频将不被展示!</text><br />
					</view>

					<view class="cj_hb_list" style="margin: 60rpx auto 0;justify-content: space-between;">
						<view class="cj_hb_list_L" style="width: 400rpx;">
							<text>使用已上传的商家资料</text>
						</view>
						<view class="cj_hb_list_R" style="display: flex;align-items: center;justify-content: flex-end;">
							<u-switch v-model="value" @change="change" activeColor="#FE4624"></u-switch>
						</view>
					</view>

					<view class="cj_hb_btn">确定</view>

					<cityPicker :column="column" :default-value="defaultValue" :mask-close-able="maskCloseAble"
						@confirm="confirmXZ" @cancel="cancel" :visible="visible" />
						
						<u-datetime-picker :show="showdate" v-model="value1" mode="datetime"
							:formatter="formatter" @cancel='showdate=false' @confirm='confirmDate'></u-datetime-picker>
				</view>
			</template>
		</view>
	</view>
</template>

<script>
	import cityPicker from '../../uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker.vue'
	export default {
		data() {
			return {
				showMB:false,
				 columnsMB: [
				                    ['模板一', '模板二', '模板三']
				                ],
				value1: Number(new Date()),
				menuButtonInfo: null,
				tab: [{
						name: '现金红包',
						isA: true
					},
					{
						name: '优惠券',
						isA: false
					},
					{
						name: '邀约',
						isA: false
					},
					{
						name: '折扣价',
						isA: false
					}
				],
				hbtype: [{
						name: '等额',
						isA: false
					},
					{
						name: '随机',
						isA: true
					}
				],
				value: true,
				checkboxvalue: false,
				visible: false,
				maskCloseAble: true,
				str: '',
				defaultValue: '',
				column: 3,
				latitude: 0, //纬度
				longitude: 0, //经度
				scale: 14, //地图缩放程度
				markers: [],
				GG_tab: [{
						name: '使用规则',
						isA: true
					},
					{
						name: '图片',
						isA: false
					},
					{
						name: '视频',
						isA: false
					}
				],
				FnaweiList: [{
						name: '选择全网',
						isA: true
					},
					{
						name: '行政范围',
						isA: false
					},
					{
						name: '地图选点',
						isA: false
					}
				],
				GG: '',
				SJbalance: 0.00,
				showdate: false,
				valueA: false,
				valueB: false,
				valueC: false,
				name: '', //店铺分类名称
				type: 1, //类型 1=红包,2=优惠券,3=邀约,4=折扣价
				total_nums: '', //总数量
				total_money: '', //金额
				red_type: 2, //红包类型 1=
				highest_money: '', //最高金额
				min_money: '', //最低
				is_forward: '', //1=可转发  2=不可转发
				forward_money: '', //转发佣金
				is_auto: 0, //抢完自动转发 0=否 1=是
				expire_day: '', //领取时段
				send_range: 1, //发放范围 1=全网  2=行政  3=选点
				coordinate: '', //选取的地址/行政范围
				distance_nums: '', //方圆公里数
				min_lng: 0, //经度最小值
				min_lat: 0, //纬度最小值
				equal_money:'',//等额金额
				MapCweiz: '',
				max_lat: 0,
				max_lng: 0,
				ad_content: '',
				start_sign: [], //签到开始
				start_signA:'',
				start_signB:'',
				end_sign: [], //签到结束
				end_signA:'',
				end_signB:'',
				TypeX:0,
				ad_type:1,
				MBname:'模板一',
				coupon_type:1
				
			}
		},
		components: {
			cityPicker
		},
		computed: {
			computedTop() {
				if (this.menuButtonInfo) {
					return `${this.menuButtonInfo.height * 2 - 6}px`;
				}
				return '0px';
			},
		},
		onShow() {
			this.GGapi()
			this.SJbalance = uni.getStorageSync('SJbalance')
		},
		onLoad() {
			const info = uni.getMenuButtonBoundingClientRect();
			this.menuButtonInfo = info;
		},
		methods: {
			LinkQianBao() {
				uni.navigateTo({
					url: '/pages/wallet/wallet'
				})
			},
			XianJinApi() {
				this.start_sign[0]=this.start_signA
				this.start_sign[1]=this.start_signB
				this.end_sign[0]=this.end_signA
				this.end_sign[1]=this.end_signB
				
				let data = {
					name: this.name, //店铺分类名称
					type: this.type, //类型 1=红包,2=优惠券,3=邀约,4=折扣价
					total_nums: this.total_nums, //总数量
					total_money: this.total_money, //金额
					red_type: this.red_type, //红包类型 1=
					equal_money:this.equal_money,//等额金额
					highest_money: this.highest_money, //最高金额
					min_money: this.min_money, //最低
					is_forward: this.is_forward, //1=可转发  2=不可转发
					forward_money: this.forward_money, //转发佣金
					is_auto: this.is_auto, //抢完自动转发 0=否 1=是
					expire_day: this.expire_day, //领取时段
					send_range: this.send_range, //发放范围 1=全网  2=行政  3=选点
					coordinate: this.coordinate, //选取的地址/行政范围
					distance_nums: this.distance_nums, //方圆公里数
					min_lng: this.min_lng, //经度最小值
					min_lat: this.min_lat, //纬度最小值
					max_lat: this.max_lat, //纬度最大值
					max_lng: this.max_lng, //经度最大值
					ad_content: this.ad_content,
					is_check: this.is_check, //核销 0=否 1=s是
					start_sign: this.start_sign, //签到开始
					end_sign: this.end_sign, //签到结束
					ad_type:this.ad_type,
					coupon_type:this.coupon_type

				}
				this.$request('/api/merchant/createActivity', data).ther((res) => {
					console.log(res, '现金红包提交');
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						});
						setTimeout(()=>{
							uni.navigateBack()
						},1900)
					}else{
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						});
						return false
					}
				})
			},
			Cmb(){
				this.showMB=true
			},
			confirmMB(e){
				console.log(e)
				this.MBname=e.value[0]
				if(e.value[0]=='模版一'){
					this.coupon_type=1
				}else if(e.value[0]=='模版二'){
					this.coupon_type=2
				}else{
					this.coupon_type=3
				}
				this.showMB=false
			},
			confirmDate(e){
				console.log(e.value,'选择的时间');
				// 假设 e.value 是时间戳（以毫秒为单位）  
				    const timestamp = e.value;  
				    // 创建一个新的 Date 对象  
				    const date = new Date(timestamp);  
				    // 获取年、月、日、小时、分钟、秒  
				    const year = date.getFullYear();  
				    const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始，需加1，并确保格式为两位数  
				    const day = String(date.getDate()).padStart(2, '0'); // 保证格式为两位数  
				    const hours = String(date.getHours()).padStart(2, '0'); // 保证格式为两位数  
				    const minutes = String(date.getMinutes()).padStart(2, '0'); // 保证格式为两位数  
				    const seconds = String(date.getSeconds()).padStart(2, '0'); // 保证格式为两位数  
				    // 格式化为 'YYYY-MM-DD HH:mm:ss'  
					const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
					
					if(this.TypeX==1){
						this.start_signA=formattedDate
					}else if(this.TypeX==2){
						this.start_signB=formattedDate
					}else if(this.TypeX==3){
						this.end_signA=formattedDate
					}else if(this.TypeX==4){
						this.end_signB=formattedDate
					}
					this.showdate = false
				    console.log(formattedDate, '选择的时间');  
			},
			Cdate(type) {
				if(type==2 && this.start_signA==''){
					uni.showToast({
						title: '请选择签到开始时间',
						icon: 'none',
						duration: 1500
					});
					return
				}
				
				if(type==4 && this.end_signA==''){
					uni.showToast({
						title: '请选择签退开始时间',
						icon: 'none',
						duration: 1500
					});
					return
				}
				
				this.TypeX=type
				this.showdate = true
			},
			formatter(type, value) {  
			    if (type === 'year') {  
			        return `${value}年`;  
			    }  
			    if (type === 'month') {  
			        return `${value}月`;  
			    }  
			    if (type === 'day') {  
			        return `${value}日`;  
			    }  
			    if (type === 'hour') {  
			        return `${value}时`;  
			    }  
			    if (type === 'minute') {  
			        return `${value}分`;  
			    }  
			    if (type === 'second') {  
			        return `${value}秒`;  
			    }  
			    return value;  
			},  
			GGapi() {
				this.$request('/api/common/getConfig').then((res) => {
					console.log(res, '公共配置');
					this.GG = res.data
				})
			},
			Cggtab(item) {
				for (var i = 0; i < this.GG_tab.length; i++) {
					this.GG_tab[i].isA = false
				}
				item.isA = true
				if (item.name == '使用规则') {
					this.ad_content = ''
					this.ad_type=1
				} else if (item.name == '图片') {
					this.ad_content = []
					this.ad_type=2
				} else {
					this.ad_content = []
					this.ad_type=3
				}
			},
			Updiveo() {
				uni.chooseVideo({
					success: (chooseImageRes) => {
						console.log(chooseImageRes, 'chooseImageRes');
						const tempFilePaths = chooseImageRes.tempFilePath;
						uni.uploadFile({
							url: this.$uts + '/api/common/upload', //仅为示例，非真实的接口地址
							filePath: tempFilePaths,
							name: 'file',
							formData: {
								token: uni.getStorageSync('token'),
								type: 1
							},
							header: {
								'token': uni.getStorageSync('token'),
								'server': 1,
							},
							success: (res) => {
								let Ima = JSON.parse(res.data)
								console.log(Ima.data.url, 'Ima-Ima-Ima');
								let dex = {
									url: Ima.data.url,
									ad_price: Ima.data.ad_price
								}
								this.ad_content.push(dex)
							}
						});
					}
				});
			},
			Upimages() {
				uni.chooseImage({
					success: (chooseImageRes) => {
						const tempFilePaths = chooseImageRes.tempFilePaths;
						uni.uploadFile({
							url: this.$uts + '/api/common/upload', //仅为示例，非真实的接口地址
							filePath: tempFilePaths[0],
							name: 'file',
							formData: {
								token: uni.getStorageSync('token'),
								type: 2
							},
							header: {
								'token': uni.getStorageSync('token'),
								'server': 1,
							},
							success: (res) => {
								let Ima = JSON.parse(res.data)
								console.log(Ima.data.url, 'Ima-Ima-Ima');
								let dex = {
									url: Ima.data.url,
									ad_price: Ima.data.ad_price
								}
								this.ad_content.push(dex)
							}
						});
					}
				});
			},
			getLatLngRange(latitude, longitude, distance) {
				const earthRadius = 6371; // 地球半径，单位为千米  

				// 转换距离到弧度  
				const latRange = distance / earthRadius * (180 / Math.PI);
				const lonRange = latRange / Math.cos(latitude * (Math.PI / 180));

				const north = latitude + latRange; // 北边界  
				const south = latitude - latRange; // 南边界  
				const east = longitude + lonRange; // 东边界  
				const west = longitude - lonRange; // 西边界  

				// 组合南北和东西的边界  
				const range = {
					vertical: {
						north: north,
						south: south
					},
					horizontal: {
						east: east,
						west: west
					}
				};

				// 打印南北和东西范围  
				console.log("南北范围: ", range.vertical);
				console.log("东西范围: ", range.horizontal);
				this.max_lat = range.vertical
				this.max_lng = range.horizontal

				return range; // 返回组合后的边界信息  
			},
			Mapselete() {
				uni.chooseLocation({
					success: res => {
						console.log(res, '点击得');
						this.MapCweiz = res.address
						this.min_lat = res.latitude
						this.min_lng = res.longitude
						if (this.distance_nums !== '') {
							const distance_numsX = this.distance_nums; // 输入的距离，单位为km  
							const range = this.getLatLngRange(this.min_lat, this.min_lng, distance_numsX);
							console.log(range, '计算后的经纬度');
						}
					},
					fail: err => {
						console.log(err, 'err-err-err');
						wx.showToast({
							title: '授权失败',
							icon: 'none',
							duration: 1000
						})
					}
				})
			},
			input() {
				if (this.distance_nums !== '') {
					const distance_numsX = this.distance_nums; // 输入的距离，单位为km  
					const range = this.getLatLngRange(this.min_lat, this.min_lng, distance_numsX);
					console.log(range, '计算后的经纬度');
				}
			},
			SeleteDW() {
				console.log('点击选择行政范围');
				this.visible = true
			},
			confirmXZ(val) {
				console.log(val)
				this.coordinate = val.name
				this.visible = false

				const address = `${val.name}`;
				const key = 'c480611b1013378bc1145c5394b892c0'; // 替换为您的高德地图API密钥

				uni.request({
					url: `https://restapi.amap.com/v3/geocode/geo?key=${key}&address=${address}`,
					success: (res) => {
						console.log(res);
						if (res.data.status === '1' && res.data.count !== '0') {
							const location = res.data.geocodes[0].location;
							const [longitude, latitude] = location.split(',');

							this.min_lat = latitude
							this.min_lng = longitude
							if (this.distance_nums !== '') {
								const distance_numsX = this.distance_nums; // 输入的距离，单位为km  
								const range = this.getLatLngRange(this.min_lat, this.min_lng, distance_numsX);
								console.log(range, '计算后的经纬度');
							}
						} else {
							uni.showToast({
								title: '网络错误:获取经纬度失败',
								icon: 'none',
								duration: 2000
							});
						}
					},
					fail: (error) => {
						console.error(error);
					},
				});

			},
			cancel() {
				this.visible = false
			},
			change(e) {
				console.log('change', e);
			},
			changeHX(e) {
				if (e === true) {
					this.is_check = 1
				} else {
					this.is_check = 0
				}
			},
			changeZF(e) {
				console.log('change', e);
				if (e === true) {
					this.is_forward = 1
				} else {
					this.is_forward = 2
				}
			},
			changeZD(e) {
				console.log('change', e);
				if (e === true) {
					this.is_auto = 1
				} else {
					this.is_auto = 0
				}
			},
			Ctype(item) {
				for (var i = 0; i < this.hbtype.length; i++) {
					this.hbtype[i].isA = false
				}
				item.isA = true

				if (item.name == '均分') {
					this.red_type = 1
				} else {
					this.red_type = 2
				}

			},
			Ctab(item, index) {
				for (var i = 0; i < this.tab.length; i++) {
					this.tab[i].isA = false
				}
				item.isA = true
				this.type = index + 1

				console.log('点击了第几个:', this.type);
			},
			Cfwei(item) {
				console.log('点击的范围', item);
				for (var i = 0; i < this.FnaweiList.length; i++) {
					this.FnaweiList[i].isA = false
				}
				item.isA = true
				//发放范围 1=全网  2=行政  3=选点
				if (item.name == '选择全网') {
					this.send_range = 1
				} else if (item.name == '行政范围') {
					this.send_range = 2
				} else {
					this.send_range = 3
				}
			},
			Back() {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss">
	.Cj {
		width: 100vw;
		min-height: 100vh;
		float: left;
		background-color: #F6F8FB;

		.message_top {
			width: 100%;
			height: 200rpx;
			position: relative;

			.message_top_title {
				width: 100%;
				text-align: center;
				font-family: PingFang SC, PingFang SC;
				font-weight: bold;
				font-size: 36rpx;
				color: #333333;
				position: absolute;
				left: 0;
				z-index: 2;
			}

			.message_top_back {
				width: 44rpx;
				height: 44rpx;
				position: absolute;
				left: 30rpx;
				z-index: 9;
			}
		}

		.Cj_box {
			width: 100vw;
			height: calc(100vh - 200rpx);
			overflow-y: scroll;
			overflow-x: hidden;
			float: left;
			padding-bottom: 40rpx;

			.Cj_tab {
				width: 710rpx;
				height: 154rpx;
				background: #FFFFFF;
				border-radius: 20rpx;
				margin: 20rpx auto 0;
				padding-top: 40rpx;
			}

			.Cj_tab>view:nth-child(1) {
				width: 650rpx;
				height: auto;
				margin: 0 auto;
				font-family: PingFang SC, PingFang SC;
				font-weight: bold;
				font-size: 28rpx;
				color: #333333;
			}

			.Cj_tab>view:nth-child(2) {
				width: 650rpx;
				height: 56rpx;
				margin: 30rpx auto 0;
				display: flex;
				align-items: center;
				justify-content: space-between;
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 28rpx;
				color: #333333;
			}

			.tab,
			.tab1 {
				width: 140rpx;
				height: 56rpx;
				background: #F2F2F2;
				border-radius: 40rpx;
				text-align: center;
				line-height: 56rpx;
			}

			.tab1 {
				background: linear-gradient(270deg, #FE4624 0%, #FF8143 100%);
				border-radius: 40rpx;
				color: #FFFFFF;
			}

			.cj_hb {
				width: 710rpx;
				background: #FFFFFF;
				border-radius: 20rpx;
				margin: 20rpx auto 0;
				padding-top: 50rpx;
				padding-bottom: 50rpx;

				.cj_hb_list {
					width: 650rpx;
					height: 70rpx;
					display: flex;
					align-items: center;
					margin: 0 auto;

					.cj_hb_list_L {
						width: 145rpx;
						height: 100%;
						display: flex;
						align-items: center;
						line-height: 70rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: bold;
						font-size: 28rpx;
						color: #333333;
					}

					.cj_hb_list_R {
						margin-left: 25rpx;
						width: 480rpx;
						height: 100%;
						display: flex;
						align-items: center;

						.cj_hb_list_R_inp {
							width: 465rpx;
							height: 68rpx;
							background: #F7F7F7;
							border-radius: 8rpx;
							border: 2rpx solid #ECECEC;
							display: flex;
							align-items: center;
						}

						.cj_hb_list_R_inp2 {
							width: 255rpx;
							padding-bottom: 15rpx;
							display: flex;
							align-items: center;
							border-bottom: 2rpx solid #333333;

						}

						.cj_hb_list_R_tab,
						.cj_hb_list_R_tab1 {
							width: 136rpx;
							height: 56rpx;
							background: #F2F2F2;
							border-radius: 40rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: 500;
							font-size: 28rpx;
							color: #333333;
							text-align: center;
							line-height: 56rpx;
							margin-right: 30rpx;
						}

						.cj_hb_list_R_tab1 {
							background: linear-gradient(270deg, #FE4624 0%, #FF8143 100%);
							color: #FFFFFF;
						}

						.cj_hb_list_selete {
							flex: 3;
							display: flex;
							align-items: center;
							font-family: PingFang SC, PingFang SC;
							font-weight: 500;
							font-size: 28rpx;
							color: #333333;
						}

					}
				}

				.cj_hb_list_text {
					width: 650rpx;
					height: 30rpx;
					display: flex;
					align-items: center;
					justify-content: flex-end;
					margin: 30rpx auto 0;
				}

				.cj_hb_list_type {
					width: 650rpx;
					height: 60rpx;
					display: flex;
					align-items: center;
					margin: 50rpx auto 0;
					font-family: PingFang SC, PingFang SC;
					font-weight: bold;
					font-size: 34rpx;
					color: #999999;
				}

				.cj_hb_list_type>view:nth-child(1),
				.cj_hb_list_type>view:nth-child(3) {
					width: 285rpx;
					height: 54rpx;
					border-bottom: 2rpx solid #E7E7E7;
					display: flex;
					align-items: center;
					padding-bottom: 10rpx;
				}

				.cj_hb_list_type>view:nth-child(2) {
					width: 17rpx;
					height: 3rpx;
					background-color: #333333;
					margin-left: 25rpx;
					margin-right: 25rpx;
				}

				.cj_hb_list_map {
					width: 650rpx;
					height: 300rpx;
					border-radius: 10rpx;
					border: 2rpx solid #E6E6E6;
					margin: 20rpx auto 0;
					overflow: hidden;
				}

				.cj_hb_list_gg {
					width: 650rpx;
					height: 56rpx;
					margin: 60rpx auto 0;
					display: flex;
					align-items: center;
					font-family: PingFang SC, PingFang SC;
					font-weight: bold;
					font-size: 28rpx;
					color: #333333;
				}

				.cj_hb_list_gg>view {
					display: flex;
					align-items: center;
					margin-left: 30rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					font-size: 28rpx;
					color: #333333;
				}

				.cj_hb_list_gg_tab,
				.cj_hb_list_gg_tab1 {
					width: 136rpx;
					height: 56rpx;
					background: #F2F2F2;
					border-radius: 40rpx;
					text-align: center;
					line-height: 56rpx;
					margin-right: 30rpx;
				}

				.cj_hb_list_gg_tab1 {
					background: linear-gradient(270deg, #FE4624 0%, #FF8143 100%);
					color: #FFFFFF;
				}

				.cj_hb_list_gg_gz {
					width: 650rpx;
					// height: 300rpx;
					margin: 10rpx auto 0;
				}

				.cj_hb_list_gg_tp {
					width: 650rpx;
					min-height: 140rpx;
					max-height: 300rpx;
					display: flex;
					align-items: center;
					flex-wrap: wrap;
					margin: 10rpx auto 0;

					.set_box_up_for_up {
						width: 180rpx;
						height: 140rpx;
						overflow: hidden;
						padding-top: 40rpx;
						background-color: #F2F2F2;
					}

					.set_box_up_for_up>view:nth-child(1) {
						width: 48rpx;
						height: 48rpx;
						text-align: center;
						line-height: 48rpx;
						margin: 0 auto;
					}

					.set_box_up_for_up>view:nth-child(2) {
						width: 100%;
						height: auto;
						text-align: center;
						font-family: PingFang SC, PingFang SC;
						font-weight: 500;
						font-size: 28rpx;
						color: #333333;
						margin-top: 20rpx;
					}

					.set_box_up_for_src {
						width: 180rpx;
						height: 180rpx;
						overflow: hidden;
						margin-right: 20rpx;
					}
				}

				.cj_hb_list_gg_sp {
					width: 650rpx;
					height: 200rpx;
					background: #FFFFFF;
					border-radius: 10rpx;
					border: 2rpx solid #E6E6E6;
					margin: 10rpx auto 0;
					overflow: hidden;

					.cj_hb_list_gg_sp_btn {
						width: 96rpx;
						height: 108rpx;
						display: flex;
						align-items: center;
						justify-content: center;
						flex-wrap: wrap;
						font-family: PingFang SC, PingFang SC;
						font-weight: 500;
						font-size: 24rpx;
						color: #333333;
						margin-bottom: 15rpx;
					}

					.cj_hb_list_gg_sp_btn>view {
						width: 48rpx;
						height: 48rpx;
						text-align: center;
						line-height: 48rpx;
						margin-bottom: 8rpx;
					}
				}

				.cj_hb_list_gg_tis {
					width: 650rpx;
					height: auto;
					margin: 60rpx auto 0;
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					font-size: 28rpx;
					color: #FF0000;
				}

				.cj_hb_btn {
					width: 710rpx;
					height: 100rpx;
					background: linear-gradient(270deg, #FE4624 0%, #FF8143 100%);
					border-radius: 50rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: bold;
					font-size: 32rpx;
					color: #FFFFFF;
					text-align: center;
					line-height: 100rpx;
					margin: 60rpx auto 0;
				}

				.cj_hb_list_moban {
					width: 650rpx;
					height: 240rpx;
					margin: 30rpx auto 0;
					background-color: skyblue;
					overflow: hidden;
				}
			}
		}
	}
</style>